package com.pointmi.customeraccountdao;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.OneToOne;
import javax.persistence.PrimaryKeyJoinColumn;

//import com.forte.cartdao.Cart;
import com.pointmi.loyaltydao.Loyalty;
import com.pointmi.transactiondao.Transaction;

@Entity
public class Customer implements Serializable{

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	
	
	@Id
	@Column
	private String customerId;
	
	@Column(name="emailAddress")
	private String email;
	
	@Column
	private String password;
		
	@Column 
	private String firstName;
	
	@Column 
	private String lastName;
	
	@Column
	private String homeAddress;
	
	@Column  
	private String city;
	
	@Column 
	private String state;
	
	@Column 
	private String country;
	
	@Column 
	private String phone;
	
	@Column
	private Date lastPasswordChangedDate;
	
	@Column
	private Date createdDate;
	
	@OneToOne(cascade = CascadeType.ALL)
	@PrimaryKeyJoinColumn
	private PasswordReset passwordReset;
	
	@OneToOne(cascade = CascadeType.ALL)
	@PrimaryKeyJoinColumn
	private Loyalty loyalty;
	
//	@OneToOne(cascade = CascadeType.ALL)
//	@PrimaryKeyJoinColumn
//	private Cart cart;
	
	@OneToMany(cascade = CascadeType.ALL)
	private List<Transaction> transaction = new ArrayList<Transaction>();
	
	public String getCustomerId()
	{
		return customerId;
	}
	
	public void setCustomerId(String customerId)
	{
	    this.customerId = customerId;
	}
	
	public String getEmail()
	{
		return email;
	}
	
	public void setEmail(String email)
	{
		this.email = email;
	}
	
	public String getPassword()
	{
		return password;
	}
	
	public void setPassword(String password)
	{
		this.password = password;
	}
	
	public String getFirstName() {
		return firstName;
	}
	

	public void setFirstName(String firstName) {
		this.firstName = firstName;
	}

	public String getLastName() {
		return lastName;
	}

	public void setLastName(String lastName) {
		this.lastName = lastName;
	}

	public String getHomeAddress() {
		return homeAddress;
	}

	public void setHomeAddress(String homeAddress) {
		this.homeAddress = homeAddress;
	}

	public String getCity() {
		return city;
	}

	public void setCity(String city) {
		this.city = city;
	}

	public String getState() {
		return state;
	}

	public void setState(String state) {
		this.state = state;
	}

	public String getCountry() {
		return country;
	}

	public void setCountry(String country) {
		this.country = country;
	}

	public String getPhone() {
		return phone;
	}

	public void setPhone(String phone) {
		this.phone = phone;
	}
	
	public Date getLastPasswordChangedDate()
	{
		return lastPasswordChangedDate;
	}
	
	public void setLastPasswordChangedDate(Date lastPasswordResetChangedDate)
	{
		this.lastPasswordChangedDate = lastPasswordResetChangedDate;
	}
	
	public Date getCreatedDate()
	{
		return createdDate;
	}
	
	public void setCreatedDate(Date createdDate)
	{
		this.createdDate = createdDate;
	}

	public PasswordReset getPassWordReset()
	{
		return passwordReset;
	}
	
	public Loyalty getLoyalty()
	{
		return loyalty;
	}

//	public Cart getCart(){
//		return cart;
//	}
}
